<?php include("header.php"); ?>
  <script>
  $(document).ready(function() {
    $("#orglist").accordion();
  });
  </script>
<div id="orglist">
<?php

$query = <<<END
	SELECT * 
	FROM  `organizations`; 
END;

$result = mysql_query($query, $connection);


while ($row = mysql_fetch_array($result))
{ 
    $name = $row[1];
    $contactName = $row[2]." ".$row[3];
    $phoneNumber = "(".$row[4].")".$row[5]."-".$row[6];
    $address = $row[7]." ".$row[8].",".$row[9].",".$row[10]." ".$row[11];
    $email = $row[12];
    $websiteAddress =  $row[13];
	$output = <<<END
	<h3><a href="#">$name</a></h3>
	<div>
		<p>
		<ul>
			<li><a href="http://maps.google.com/?q=$address" target="_blank">$address</a></li>
			<li>$contactName</li>
			<li>$phoneNumber</li>
			<li>$email</li>
			<li><a href="http://$websiteAddress">$websiteAddress</a></li>
		</ul>
		</p>
	</div>
END;
	echo $output;
}
?>
</div>

<?php include("footer.php"); ?>